<?php
/**
 * Pertyler DatabaseManagement
 * Control
 * Logout
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pertyler;

require_once __DIR__ . '/main.php';

require_once __DIR__ . '/../databaseModel/Role.php';

if($moderator = Role_Moderator::Select())
	if($moderator->Logout())
		\Pert\Page::Get()->AddScript('
parent.topMenu.document.location.reload();
parent.leftMenu.document.location.reload();
window.close();');

unset($moderator);

echo \Pert\Page::Get()->HeaderHTML();

require __DIR__ . '/../view/Logout.php';

echo \Pert\Page::Get()->FooterHTML();

return true;
